<template>
  <div>
    <h1>组件四</h1>
    <button @click="toParent">四传父</button>
    <button @click="toParent1">3四传父</button>
  </div>
</template>
<script>console.log(this)
export default {
  props: ['title', 'index', 'action', 'userName', 'fromChild3'],
  data () {
    return {
    }
  },
  methods: {
    childInput: function (e) {
      this.$emit('toParent', e.target.value)
    },
    toParent: function () {
      this.$parent.fromChild3('这是四儿子给父亲的')
    },
    toParent1: function () {
      this.fromChild3('3四儿子-')
    }
  }
}
</script>
<style scoped>
  input{
    border: 1px solid #ccc;
  }
  *{
    color: #ff0000;
  }
</style>
